import { $post, $put } from '@js/request'

// 添加部门
export async function addDepartmentRequest (code: string, pid: string, name: string, sname: string): Promise<void> {
  const res = await $post('/api/common/structure', {
    tenant_code: code,
    pid,
    name,
    sname,
    type: 'LawFirm'
  })
  return res.data
}

// 修改部门
export async function updateDepartmentRequest (id: string, code: string, pid: string, name: string, sname: string): Promise<void> {
  const res = await $put(`/api/common/structure/${id}`, {
    tenant_code: code,
    pid,
    name,
    sname,
    type: 'LawFirm'
  })
  return res.data
}
